
import request from '@/utils/request'

export default {

  //1 首页文章
  getIndexArticle() {
    return request({
      url: '/itservice/articlefront/getIndexArticle',
      method: 'get'
    })
  },
  //2 分页查看
  getPageArticle(page, limit) {
    return request({
      url: `/itservice/articlefront/pageArticle/${page}/${limit}`,
      method: 'get'
    })
  },
  //3 根据id查看image信息
  getArticleInfoById(articleId) {
    return request({
      url: `/itservice/articleadmin/getArticleById/${articleId}`,
      method: 'get'
    })
  },
  // 4 分页获取文章全部信息
  getPageAllFieldArticle(page, limit) {
    return request({
      url: `/itservice/articlefront/getPageAllFieldArticle/${page}/${limit}`,
      method: 'get'
    })
  },
  // 5 根据id获取视频浏览数或者自增视频播放量（flag等于0获取，等于1自增）
  getViewNumOrAddViewNumById(articleId, flag) {
    return request({
      url: `/itservice/articlefront/getViewNumOrAddViewNumById/${articleId}/${flag}`,
      method: 'get'
    })
  },
  // 6 写入文章浏览记录
  addRecord() {
    return request({
      url: '/itservice/articlerecord/addRecord',
      method: 'get'
    })
  },
  // 7 查看文章分类
  getAllArticleClasses() {
    return request({
      url: '/itservice/articleadmin/getAllArticleClasses',
      method: 'get'
    })
  },
  // 8 查看文章分类
  getArtilceListByClassesId(page, limit, articleClassesId) {
    return request({
      url: `/itservice/articlefront/getArtilceListByClassesId/${page}/${limit}/${articleClassesId}`,
      method: 'get'
    })
  }
}
